package cn.wangzg.fragmentdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;

public class DynamicLoadActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_dynamic_load);

        getSupportFragmentManager()
                .beginTransaction()//开始事务
                .replace(R.id.fl_frag,//指定Fragment放入的容器
                        FragmentOne.newInstance("Dynamic Load..."))//创建Fragment
                .commit();//提交事务
    }
}
